package com.jd.service.impl;

import com.jd.entity.User;
import com.jd.mapper.UserMapper;
import com.jd.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 平台用户 服务实现类
 * </p>
 *
 * @author wangshuping
 * @since 2021-11-15
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {


    @Override
    public User getAdminUserByUsername(String username) {
        return baseMapper.getAdminUserByUsername(username);
    }

    @Override
    public User getCommonUserByUsername(String username) {
        return baseMapper.getCommonUserByUsername(username);
    }

    @Override
    public List<String> getAllResources() {
        return baseMapper.getAllResources();
    }

    @Override
    public String selectRoleCode(Long userId,String adminRole) {
        return baseMapper.selectRoleCode(userId,adminRole);
    }

    @Override
    public List<String> getResourcesByUserId(Long userId) {
        return baseMapper.getResourcesByUserId(userId);
    }
}
